<?php
namespace Plu\Library\Services\Redis\Media;

use Plu\Library\Services\ServiceBase;

class MediaRedis extends ServiceBase {
	const key_of_room_pv_conter = "room:pvcounter:%s";

	/**
	 * 获取单部视频的点播数
	 */
	public function getVideoPVCount($roomId, $mediaId) {
		$hashKey = sprintf(self::key_of_room_pv_conter, date("ymd"));
		$guid = sprintf("v:%d:%d", $roomId, $mediaId);

		$redis = $this->getRedis("cache");
		return $redis->hGet($hashKey, $guid);
	}

	/**
	 * 获取多部视频的点播数
	 * 格式为 [$roomId:$mediaId]
	 */
	public function getVideosPVCount($ids) {
		$hashKey = sprintf(self::key_of_room_pv_conter, date("ymd"));
	}
}
?>
